package com.kevintam;

public class Reversal {

    //打印字符串
    public void reverse(String input,int index) {
        //反转字符串
        if(index==input.length()){
            return;
        }
        reverse(input,index+1);
        System.out.println(input.charAt(index));
    }

    public static void main(String[] args) {
        Reversal r = new Reversal();
        r.reverse("hello",0);
    }
}
